var readline = require('readline-sync')
readline.setDefaultOptions({prompt: ''})
var readline = readline.prompt
while(line = readline()){
  let [m,n] = line.split(' ').map(item => parseInt(item))
  let flag = false
  let res = []
  for(let i = m;i <= n;i++){
    if(shuixian(i)){
      flag = true
      res.push(i)
    }
  }
  if(flag === false){
    console.log('no')
  }else{
    console.log(...res)
  }
}
function shuixian(x){
  let xCopy = x
  let sum = 0
  while(x){
    let gewei = x % 10
    sum += gewei * gewei * gewei
    x = Math.floor(x / 10)
  }
  return sum === xCopy
}